package beans.binders;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

import org.codehaus.jettison.json.JSONObject;

import play.Logger;
import play.data.binding.Global;
import play.data.binding.TypeBinder;

@Global
public class JSONObjectBinder implements TypeBinder<JSONObject> {
	@Override
	public Object bind(String name, Annotation[] annotations, String value,
			Class actualClass, Type genericType) throws Exception {
		Logger.info(value);
    	return new JSONObject(value);
	}

}